Page({
  data: {
    url: ''
  },
  onLoad(options) {
    let userInfo = my.getStorageSync({key: 'userInfo'}).data

    let otherParams= {
      nickName: (userInfo.name || '未知') + '_'  + userInfo.mobile
    }

    console.log(otherParams)

    let customField = {
      username: userInfo.name || '',
      mobile: userInfo.mobile
    }
    
    let url = `https://ykf-webchat.7moor.com/wapchat.html?accessId=3db480a0-fec7-11ed-b114-872d65dfebc3&language=ZHCN&customField=${JSON.stringify(customField)}&otherParams=${JSON.stringify(otherParams)}&clientId=${userInfo.mobile}`

    this.setData({
      url
    })
  },
});
